package system;
import java.sql.*;
public class createMultipleSelection{
	String question_id,topic,selection_A,selection_B,selection_C,selection_D,selection_true_A,selection_true_B,selection_true_C,selection_true_D;
	
	public void setQuestion_id(String str){
		try{
			byte b[]=str.getBytes("ISO-8859-1");
            question_id=new String(b);
		} catch(Exception e){}
	}
	public String getQuestion_id(){
		return question_id;
	}
	
	public void setTopic(String str){
		try{
			byte b[]=str.getBytes("ISO-8859-1");
            topic=new String(b);
		} catch(Exception e){}
	}
	public String getTopic(){
		return topic;
	}
	
	public void setSelection_A(String str){
		try{
			byte b[]=str.getBytes("ISO-8859-1");
            selection_A=new String(b);
		} catch(Exception e){}
	}
	public String getSelection_A(){
		return selection_A;
	}
	
	public void setSelection_B(String str){
		try{
			byte b[]=str.getBytes("ISO-8859-1");
            selection_B=new String(b);
		} catch(Exception e){}
	}
	public String getSelection_B(){
		return selection_B;
	}
	
	public void setSelection_C(String str){
		try{
			byte b[]=str.getBytes("ISO-8859-1");
            selection_C=new String(b);
		} catch(Exception e){}
	}
	public String getSelection_C(){
		return selection_C;
	}
	
	public void setSelection_D(String str){
		try{
			byte b[]=str.getBytes("ISO-8859-1");
            selection_D=new String(b);
		} catch(Exception e){}
	}
	public String getSelection_D(){
		return selection_D;
	}
	
	public void setSelection_True_A(String str){
		try{
			byte b[]=str.getBytes("ISO-8859-1");
            selection_true_A=new String(b);
		} catch(Exception e){}
	}
	public String getSelection_True_A(){
		return selection_true_A;
	}
	
	public void setSelection_True_B(String str){
		try{
			byte b[]=str.getBytes("ISO-8859-1");
            selection_true_B=new String(b);
		} catch(Exception e){}
	}
	public String getSelection_True_B(){
		return selection_true_B;
	}
	
	public void setSelection_True_C(String str){
		try{
			byte b[]=str.getBytes("ISO-8859-1");
            selection_true_C=new String(b);
		} catch(Exception e){}
	}
	public String getSelection_True_C(){
		return selection_true_C;
	}
	
	public void setSelection_True_D(String str){
		try{
			byte b[]=str.getBytes("ISO-8859-1");
            selection_true_D=new String(b);
		} catch(Exception e){}
	}
	public String getSelection_True_D(){
		return selection_true_D;
	}
	
	public boolean getCreate(){
		boolean  insert=false;
		String insertCondition="insert into multiple_selection values('"+question_id+"','"+topic+"','"+selection_A+"','"+selection_B+"','"+selection_C+"','"+selection_D+"','"+selection_true_A+"','"+selection_true_B+"','"+selection_true_C+"','"+selection_true_D+"')";
		Connection con;
	    Statement sql;
	    try{
	    	Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
	    	}
	    catch(Exception e){}
   
    try{
		String uri = "jdbc:sqlserver://127.0.0.1:1433;DatabaseName=test_system";
		String user = "sa";
		String password = "sa";
		con=DriverManager.getConnection(uri,user,password);
		sql=con.createStatement();
		int m=sql.executeUpdate(insertCondition);
		if(m!=0){
			insert=true;			
		}
		con.close();
	}
	catch(SQLException e1){insert=false;}
	return insert;
	}
}